package com.baomidou.mybatisplus.samples.typehandler.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.mysql.cj.jdbc.BlobFromLocator;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.ibatis.type.BlobInputStreamTypeHandler;
import org.apache.ibatis.type.BlobTypeHandler;

import java.io.InputStream;
import java.sql.Blob;

/**
 * <p>
 * 用户实体对应表 user
 * </p>
 *
 * @author hubin
 * @since 2018-08-11
 */
@Data
@Accessors(chain = true)
@TableName(autoResultMap = true)
public class User {
    private Long id;
    @TableField(typeHandler = BlobInputStreamTypeHandler.class)
    private InputStream data;
}
